package com.xhdx;

import java.math.BigDecimal;
import java.util.Random;
import java.util.UUID;

public class Test {
    
    public static void main(String args[]){
        Double amt = 66.10;
        Double amtDouble = amt*100;
        Long amtLong = amtDouble.longValue();
        System.out.println("amt="+amt+";amtDouble="+amtDouble+";amtLong="+amtLong);
        
        BigDecimal bigAmt = new BigDecimal(66.10);
        BigDecimal bigAmt100 = bigAmt.multiply(new BigDecimal(100.00)).setScale(2, BigDecimal.ROUND_HALF_UP);
        Long bigAmtLong = bigAmt100.longValue();
        System.out.println("bigAmt="+bigAmt+";bigAmt100="+bigAmt100+";bigAmtLong="+bigAmtLong);
        
        BigDecimal bd = new BigDecimal(amt).setScale(2, BigDecimal.ROUND_HALF_UP);
        System.out.println(bd.multiply(BigDecimal.valueOf(100)).longValue());
        String p = UUID.randomUUID().toString();
        System.out.println(p.replace("-", ""));
        p = p.replace("-", "").substring(16);
        System.out.println(p);
        
        String carbin = "621458,621036,621536,625126,628320";
        String carbins[] = carbin.split(",");
        for (int i = 0; i < carbins.length; i++) {
            
            if ("16283206283201111111".indexOf(carbins[i]) == 0) {
                System.out.println(carbins[i]);
            }
        }
        
        BigDecimal bigAmt1 = new BigDecimal(66.000000001);
        BigDecimal bigAmt1001 = bigAmt1.setScale(2, BigDecimal.ROUND_HALF_UP);
        System.out.println(bigAmt1001);
        
        System.out.println(Integer.MAX_VALUE*2); 
        System.out.println(Integer.MIN_VALUE*2); 
        Integer certTyp = 2;
        System.out.println(certTyp.toString()); 
        
        Random r = new Random();
        System.out.println("------"); 
        System.out.println(r.nextInt(2)); 
        System.out.println(r.nextInt(2));
        
        System.out.println(r.nextInt(2));
        System.out.println(r.nextInt(2));
        System.out.println(r.nextInt(2));
        System.out.println(r.nextInt(2)); 
        System.out.println(r.nextInt(2));
        
        System.out.println(r.nextInt(2));
        System.out.println(r.nextInt(2));
        System.out.println(r.nextInt(4));
        
        String cardNo = "987654321";
        System.out.println(cardNo.charAt(0));
     }
}
